package com.li.mapper;

import com.li.pojo.dto.RoleDeptDTO;
import com.li.pojo.dto.RolePageDto;
import com.li.pojo.po.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-04-13
 */
public interface RoleMapper extends BaseMapper<Role> {

    List<Role> findByPage(RolePageDto rolePageDto);

    @Update("update sys_role set status=#{status} where role_id=#{roleId}")
    void changeStatus(Integer roleId, String status);

    void updateRole(Role role);

    @Select("select * from sys_role")
    List<Role> getAll();
}
